package com.aqiang.day0528_shop.main.presenter

import com.aqiang.day0528_shop.main.contract.SearchGoodsContract
import com.aqiang.day0528_shop.main.model.SearchGoodsModel

class SearchGoodsPresenter(var v:SearchGoodsContract.SearchGoodsView) : SearchGoodsContract.SearchGoodsPresenter(v) {
    override fun searchGoods() {
        if(mView != null && mView.get() != null){
            val searchGoods = mModel.searchGoods(mView.get()!!.getKeyWork(),mView.get()!!.getType())
            mView.get()!!.initAdapter(searchGoods)
        }
    }

    override fun initModel(): SearchGoodsContract.SearchGoodsModel {
        return SearchGoodsModel()
    }
}